﻿using System.Windows;

namespace WpfApp_Command
{

    /// <summary>
    /// 命令触发的业务代码
    /// </summary>
    public class MainViewModel
    {
        public MyCommand ShowCommand { get; set; }
        public MyCommand ShowNewCommand { get; set; }
        public MainViewModel()
        {
            ShowCommand = new MyCommand(Show);
            ShowNewCommand = new MyCommand(ShowNew);
        }

        public void Show()
        {
            MessageBox.Show("按钮被点击了");
        }

        public void ShowNew()
        {
            MessageBox.Show("我点击了其他按钮");
        }

    }
}